<template>
  <div class="app-container">
    <el-form ref="dataForm" :rules="rules" :model="temp" label-position="left" label-width="190px"
             style="width: 100%; padding: 0 30px;">

      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="项目名称" prop="projectName">
            <el-input maxlength="50"  v-model="temp.projectName"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="" prop="">
            <el-button  class="filter-item" size="small" type="primary" plain icon="el-icon-search"
                        @click="queryRepeat">
              查询相似项目
            </el-button>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="项目地址" prop="projectAddr">
            <el-input maxlength="50"  v-model="temp.projectAddr"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="项目负责人" prop="projectMainUnitLinkman">
            <el-input  maxlength="50" v-model="temp.projectMainUnitLinkman"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="联系电话" prop="telephone">
            <el-input v-model="temp.telephone"/>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="项目依据" prop="projectBasis">
            <el-input maxlength="500"  v-model="temp.projectBasis"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="建安投资" prop="totalInvestment">
            <el-input  v-model="temp.totalInvestment" @change="totalInvestmentEvent"/>
          </el-form-item>



        </el-col>
        <el-col :span="12">
          <el-form-item label="万" prop="">

          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="资金来源">
            <el-form  label-width="80px">
              <el-col :span="8">
                <el-form-item label="市财力(万)" prop="fundSourceCityFinacial">
                  <el-input v-model="temp.fundSourceCityFinacial"/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="区财政(万)" prop="fundSourceDistrictFinance">
                  <el-input v-model="temp.fundSourceDistrictFinance"/>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="其他(万)" prop="fundSourceOthers">
                  <el-input v-model="temp.fundSourceOthers"/>
                </el-form-item>
              </el-col>
            </el-form>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="项目预计开工时间" prop="startTimePlan">
            <el-date-picker
              style="width:100%;"
              v-model="temp.startTimePlan"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="项目预计完工时间" prop="endTimePlan">
            <el-date-picker
              style="width:100%;"
              v-model="temp.endTimePlan"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="项目实际开工时间" prop="startTimeActual">
            <el-date-picker
              style="width:100%;"
              v-model="temp.startTimeActual"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="项目实际完工时间" prop="endTimeActual">
            <el-date-picker
              style="width:100%;"
              v-model="temp.endTimeActual"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
<!--        <el-col :span="15">
          <el-form-item label="投资监理" prop="investmentSupervision">
            <el-cascader
              v-model="temp.investmentSupervision"
              :options="investmentSupervisionData"
              :props="{ expandTrigger: 'hover', children:'mhCategoryList', label:'name', value:'id' }"
              @change="investmentSupervisionEvent"
              style="width:100%;"
            ></el-cascader>
          </el-form-item>
        </el-col>-->
        <!--<el-col :span="9">
          <el-form-item label="投资监理时间" label-width="130px" prop="investmentSupervisionTime">
            <el-date-picker
              v-model="temp.investmentSupervisionTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期"
              style="width:100%;">
            </el-date-picker>
          </el-form-item>
        </el-col>-->
        <el-col :span="15">
          <el-form-item label="施工监理" prop="constructionSupervision">
            <el-cascader
              :key="key"
              v-model="temp.constructionSupervision"
              :options="constructionSupervisionData"
              :props="{children:'mhCategoryList', label:'name', value:'id' }"
              @change="constructionSupervisionEvent"
              style="width:100%;"
            ></el-cascader>
          </el-form-item>
        </el-col>
        <el-col :span="9">
          <el-form-item label="施工监理时间" label-width="130px" prop="constructionSupervisionTime">
            <el-date-picker
              v-model="temp.constructionSupervisionTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期"
              style="width:100%;">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="15">
          <el-form-item label="财务监理" prop="finacialSupervision">
            <el-cascader
              v-model="temp.finacialSupervision"
              :options="finacialSupervisionData"
              :props="{ expandTrigger: 'hover', children:'mhCategoryList', label:'name', value:'id' }"
              @change="finacialSupervisionEvent"
              style="width:100%;"></el-cascader>
          </el-form-item>
        </el-col>
        <el-col :span="9">
          <el-form-item label="财务监理时间" label-width="130px" prop="finacialSupervisionTime">
            <el-date-picker
              v-model="temp.finacialSupervisionTime"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="选择日期"
              style="width:100%;">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <!--<el-col :span="12">
          <el-form-item label="发起方单位" prop="projectMainUnit">
            <el-input v-model="temp.projectMainUnit"/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="电话" prop="phone">
            <el-input v-model="temp.phone"/>
          </el-form-item>
        </el-col>-->
      </el-row>
    </el-form>
    <!--BankupsAndRestore-->
    <el-dialog title="已有相似项目" :visible.sync="dialog4ListVisible" width="30%" append-to-body >
      <div id="projectList">
        <el-scrollbar style="height: 300px;">
          <div class="seamless-warp">
            <ul class="item">
              <li v-for="(item, index) in similarProjectList" :key="index">
                <span style="width: 80%; text-align: left; color: #df5000;" v-text="item.projectName" ></span>
                <span>&nbsp;&nbsp;&nbsp;</span>
                <span style="width: 80%; text-align: left; color: #df5000;" v-text="item.projectMainUnitLinkman" ></span>
                <span>&nbsp;&nbsp;&nbsp;</span>
                <span style="width: 20%; text-align: right;" v-text="item.createdate" ></span>
              </li>
            </ul>
          </div>
        </el-scrollbar>
      </div>
      <el-button @click="dialog4ListVisible = false">
        取消
      </el-button>
      <el-button type="primary" @click="confirmContinue" >
        继续提交
      </el-button>
    </el-dialog>
  </div>
</template>

<script>
import { createApi, updateApi, fetchList, treeProjCategory, fetchListSimilar } from './api'
  // 导入多选项组件
  import SelectOption from '@/views/coding/components/SelectOption'

  export default {
    name: 'MhProjectInfo-FormDetail',

    components: { SelectOption },

    props: {
      isModule: {
        type: Boolean,
        default: false
      },
      row: {}
    },

    data() {
      var checkMobile = (rule, value, cb) => {
        const regMobile = /^[1][3,4,5,7,8][0-9]{9}$/
        if (regMobile.test(value)) {
          return cb()
        }
        cb(new Error('只能输入11位手机号'))
      }
      var isnumber = (rule, value, callback) => {
        if (!value) {
          callback();
        } else {
          var reg = /^-?\d{1,16}(?:\.\d{1,4})?$/;//小数点左边最高16位，小数点右边最多4位
          if (reg.test(value)) {
            callback();
          } else {
            callback(new Error("输入正确的数字,小数点后可1到4位"));
          }
        }
      };
      return {
        createFlag:false,
        similarProjectList: [],
        checked: true,
        dialog4ListVisible:false,
        rules: {
          projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],/*
          projectAddr: [{ required: true, message: 'required', trigger: 'blur' }],*/
          projectMainUnitLinkman: [{ required: true, message: '请输入负责人', trigger: 'blur' }],
          projectBasis: [{ required: true, message: '请输入项目依据', trigger: 'blur' }],
          telephone: [{ required: true, message: '请输入联系电话', trigger: 'blur' }, {
            validator: checkMobile,
            trigger: 'blur'
          }],
          // fundSourceCityFinacial: [{ required: true, message: 'required', trigger: 'blur' }],
          // fundSourceDistrictFinancing: [{ required: true, message: 'required', trigger: 'blur' }],
          // fundSourceDistrictFinance: [{ required: true, message: 'required', trigger: 'blur' }],
          // fundSourceOthers: [{ required: true, message: 'required', trigger: 'blur' }],
          /*categoryProject: [{ required: true, message: 'required', trigger: 'blur' }],*/
          totalInvestment: [{ required: true, message: '请输入建安投资', trigger: 'blur' }, {
            validator: isnumber,
            trigger: 'blur'
          }],
          startTimePlan: [{ required: true, message: '请输入预计项目开始时间', trigger: 'blur' }],
          endTimePlan: [{ required: true, message: '请输入项目预计结束时间', trigger: 'blur' }],
          /*startTimeActual: [{ required: true, message: 'required', trigger: 'blur' }],
          endTimeActual: [{ required: true, message: 'required', trigger: 'blur' }],*/
          //investmentSupervision: [{ required: true, message: 'required', trigger: 'blur' }],
          //investmentSupervisionTime: [{ required: true, message: 'required', trigger: 'blur' }],
          // constructionSupervision: [{ required: true, message: 'required', trigger: 'blur' }],
          // constructionSupervisionTime: [{ required: true, message: 'required', trigger: 'blur' }],
          //finacialSupervision: [{ required: true, message: 'required', trigger: 'blur' }],
          //finacialSupervisionTime: [{ required: true, message: 'required', trigger: 'blur' }],
          // projectMainUnit: [{ required: true, message: 'required', trigger: 'blur' }],
          // phone: [{ required: true, message: 'required', trigger: 'blur' }],
          // deleteflag: [{ required: true, message: 'required', trigger: 'blur' }]
        },
        temp: {},
        key: 1,
        constructionSupervisionData: [],
        /*investmentSupervisionData: [],*/
        finacialSupervisionData: [],
        constructionSupervisionValue:undefined
      }
    },

    watch: {
      'row': {
        immediate: true, // vue首次赋值不触发watch的解决方法
        handler: function(nval) {
          if (this.isModule) {
            // this.temp = Object.assign({}, this.row) // copy obj
            if (this.isNull(nval)) {
              return
            }
            if (this.isNull(nval.id)) {
              return
            }
            this.getList(nval.id)
          }
        }
      }
    },

    mounted() {
      this.treeProjCategory(1)
      this.treeProjCategory(2)
      this.treeProjCategory(3)
    },
    methods: {
      confirmContinue(){
        this.dialog4ListVisible = false

        if(this.createFlag){
          this.$refs['dataForm'].validate((valid) => {
            if (valid) {
              this.$confirm('确认提交吗？').then(_ => {
                // create api
                const param = Object.assign({}, this.temp)
                //项目状态改为提交
                param.status = 0
                createApi(param).then((r) => {
                  this.notify(r)
                  if (r.success) {
                    this.resetTemp()
                    // 从父组件调用此方法，进行回调下
                    if (this.isModule) {
                      this.$emit('createResult')
                    }
                  }
                })
                // end
              })
                .catch(_ => {
                })

            }
          })
        }else{
          this.$refs['dataForm'].validate((valid) => {
            if (valid) {
              this.$confirm('确认提交吗？').then(_ => {
                // columnsTag.column4Add
                const param = { id: this.temp.id }
                param.unitBidderId = this.temp.unitBidderId
                param.status = 0
                param.remark = this.temp.remark
                param.rejectReason = this.temp.rejectReason
                param.fileAddress = this.temp.fileAddress
                param.projectName = this.temp.projectName.trim()
                param.projectAddr = this.temp.projectAddr
                param.projectMainUnitLinkman = this.temp.projectMainUnitLinkman
                param.telephone = this.temp.telephone
                param.projectBasis = this.temp.projectBasis
                param.totalInvestment = this.temp.totalInvestment
                param.fundSourceCityFinacial = this.temp.fundSourceCityFinacial
                param.fundSourceDistrictFinance = this.temp.fundSourceDistrictFinance
                param.fundSourceOthers = this.temp.fundSourceOthers
                param.startTimePlan = this.temp.startTimePlan
                param.endTimePlan = this.temp.endTimePlan
                param.startTimeActual = this.temp.startTimeActual
                param.endTimeActual = this.temp.endTimeActual
                /*param.investmentSupervision = this.temp.investmentSupervision*/
                param.investmentSupervisionTime = this.temp.investmentSupervisionTime
                param.constructionSupervision = this.temp.constructionSupervision
                param.constructionSupervisionTime = this.temp.constructionSupervisionTime
                param.finacialSupervision = this.temp.finacialSupervision
                param.finacialSupervisionTime = this.temp.finacialSupervisionTime
                param.projectMainUnit = this.temp.projectMainUnit
                param.phone = this.temp.phone
                param.deleteflag = this.temp.deleteflag
                createApi(param).then((r) => {
                  this.notify(r)
                  if (r.success) {
                    this.resetTemp()
                    // 从父组件调用此方法，进行回调下
                    if (this.isModule) {
                      this.$emit('updateResult')
                    }
                  }
                })
              })
                .catch(_ => {
                })

            }
          })
        }
      },
      queryRepeat(){
        this.dialog4ListVisible = true
        // console.log(this.temp.projectName)
        if(this.temp.projectName!==undefined){
          this.queryRepeatList()
        }
      },
      queryRepeatList(){
        const params = { projectName: this.temp.projectName.trim() }
        params.page = 1;
        params.limit = 1000;
        params.status = 0;
        fetchListSimilar(params).then(result => {
          if (result.success) {
            this.similarProjectList = result.map.rows
          }
        })
      },
      treeProjCategory(id){
        treeProjCategory({id:id}).then(r=>{
          if(id===1) {
            this.constructionSupervisionData = r.obj.mhCategoryList
          }
          if(id===2) {
            this.finacialSupervisionData = r.obj.mhCategoryList
          }
          /*if(id===3) {
            this.investmentSupervisionData = r.obj.mhCategoryList
          }*/
        })
      },
      totalInvestmentEvent(money) {
        this.categoryIteratorAddDisabled(money, this.constructionSupervisionData)
        /*this.categoryIteratorAddDisabled(money, this.investmentSupervisionData)*/
        this.categoryIteratorAddDisabledExclude(money, this.finacialSupervisionData)
        this.key++
      },
      constructionSupervisionEvent(val) {
        if (val===undefined) return
        this.temp.constructionSupervision = val[val.length-1]
      },
      /*investmentSupervisionEvent(val) {
        if (val===undefined) return
        this.temp.investmentSupervision = val[val.length-1]
      },*/
      finacialSupervisionEvent(val) {
        if (val===undefined) return
        this.temp.finacialSupervision = val[val.length-1]
      },
      categoryIteratorAddDisabled(money, list){
        const self = this;
        list.forEach(item=>{
          if (!self.isNull(item.mhCategoryList)) {
            this.categoryIteratorAddDisabled(money, item.mhCategoryList)
            return true;
          }
          if (self.isNull(item.min) || self.isNull(item.max)) return true; // continue
          if (money>item.min && money<=item.max) {
            item.disabled=false;
          }else{
            item.disabled=true;
          }

        })
      },
      categoryIteratorAddDisabledExclude(money, list){
        const self = this;
        list.forEach(item=>{
          if (!self.isNull(item.mhCategoryList)) {
            this.categoryIteratorAddDisabledExclude(money, item.mhCategoryList)
            return true;
          }
          if (self.isNull(item.min) || self.isNull(item.max)) return true; // continue
          if (money>item.min && money<item.max) {
            item.disabled=false;
          }else{
            item.disabled=true;
          }

        })
      },
      getList(_id) {
        this.resetTemp()
        fetchList({ id: _id }).then(result => {
          if (!result.success) {
            this.notify(result)
            return
          }
          this.temp = result.map.rows[0]
          this.temp.constructionSupervision = Number(this.temp.constructionSupervision)
          this.temp.finacialSupervision = Number(this.temp.finacialSupervision)
          /*this.temp.investmentSupervision = Number(this.temp.investmentSupervision)*/
        })
      },
      // 给外部调用，清空form
      resetTemp() {
        this.temp = {
          unitBidderId: '',
          status: '',
          remark: '',
          rejectReason: '',
          fileAddress: '',
          projectName: '',
          projectAddr: '',
          projectMainUnitLinkman: '',
          telephone: '',
          projectBasis: '',
          totalInvestment: 0,
          fundSourceCityFinacial: 0,
          fundSourceDistrictFinance: 0,
          fundSourceOthers: 0,
          startTimePlan: '',
          endTimePlan: '',
          startTimeActual: '',
          endTimeActual: '',
   /*       investmentSupervision: 0,*/
          /*investmentSupervisionTime: '',*/
          constructionSupervision: 0,
          constructionSupervisionTime: '',
          finacialSupervision: 0,
          finacialSupervisionTime: '',
          projectMainUnit: '',
          phone: '',
          deleteflag: '',
          id: undefined
        }
      },
      // 给外部调用，设置默认值，请根据实际情况修改id值
      defaultTemp() {
        this.temp = {
          status: 3, //设置默认值
          // investmentSupervision: 0, //设置默认值
          // constructionSupervision: 0, //设置默认值
          // finacialSupervision: 0, //设置默认值
          deleteflag: 0 //设置默认值
        }
      },
      // 树表： 拿当前节点ID作为父节点ID，建立树关系
      setParentNodeId(id) {
        // this.temp.mhProjectInfoId = id
        this.temp.parentId = id
      },
      // 给外部调用，插入记录
      createData() {
        if(
          /*this.temp.investmentSupervision===undefined && */
          this.temp.constructionSupervision===undefined && this.temp.finacialSupervision===undefined){
          alert('施工监理或财务监理至少要选择其中一项')
          return
        }else if(
          /*this.temp.investmentSupervision===0 && */
          this.temp.constructionSupervision===0 && this.temp.finacialSupervision===0){
          alert('施工监理或财务监理至少要选择其中一项')
          return
        }
        if(this.temp.projectName!==undefined){
          const params = { projectName: this.temp.projectName.trim() }
          params.page = 1;
          params.limit = 1000;
          params.status = 0;
          fetchList(params).then(result => {
            if (result.success) {
              this.similarProjectList = result.map.rows
              if(this.similarProjectList.length>0){
                this.dialog4ListVisible = true
              }
              else
                {
                this.dialog4ListVisible = false
                this.$refs['dataForm'].validate((valid) => {
                  if (valid) {

                    this.$confirm('确认提交吗？').then(_ => {
                      // create api
                      const param = Object.assign({}, this.temp)
                      //项目状态改为提交
                      param.status = 0
                      createApi(param).then((r) => {
                        this.notify(r)
                        if (r.success) {
                          this.resetTemp()
                          // 从父组件调用此方法，进行回调下
                          if (this.isModule) {
                            this.$emit('createResult')
                          }
                        }
                      })
                      // end
                    })
                      .catch(_ => {
                      })

                  }
                })
              }


            }
          })
        }
      },
      // 给外部调用，插入暂存记录
      createTmpData() {
        this.$refs['dataForm'].validate((valid) => {
          if (valid) {
            const param = Object.assign({}, this.temp)
            //项目状态改为暂存
            param.status = 3
            createApi(param).then((r) => {
              this.notify(r)
              if (r.success) {
                this.resetTemp()
                // 从父组件调用此方法，进行回调下
                if (this.isModule) {
                  this.$emit('createResult')
                }
              }
            })
          }
        })
      },
      // 给外部调用，修改记录,状态status为0提交

      updateData() {
        this.createFlag = false
        if(
          /*this.temp.investmentSupervision===undefined && */
          this.temp.constructionSupervision===undefined && this.temp.finacialSupervision===undefined){
          alert('施工监理或财务监理至少要选择其中一项')
          return
        }else if(
         /* this.temp.investmentSupervision===0 && */
          this.temp.constructionSupervision===0 && this.temp.finacialSupervision===0){
          alert('施工监理或财务监理至少要选择其中一项')
          return
        }
        if(this.temp.projectName!==undefined){

          const params = { projectName: this.temp.projectName.trim() }
          params.page = 1;
          params.limit = 1000;
          params.status = 0;
          fetchList(params).then(result => {
            if (result.success) {
              this.similarProjectList = result.map.rows

              if(this.similarProjectList.length>0){
                this.dialog4ListVisible = true
              }
              else
              {
                this.dialog4ListVisible = false
                this.$refs['dataForm'].validate((valid) => {
                  if (valid) {
                    this.$confirm('确认提交吗？').then(_ => {
                      // columnsTag.column4Add
                      const param = { id: this.temp.id }
                      param.unitBidderId = this.temp.unitBidderId
                      param.status = 0
                      param.remark = this.temp.remark
                      param.rejectReason = this.temp.rejectReason
                      param.fileAddress = this.temp.fileAddress
                      param.projectName = this.temp.projectName.trim()
                      param.projectAddr = this.temp.projectAddr
                      param.projectMainUnitLinkman = this.temp.projectMainUnitLinkman
                      param.telephone = this.temp.telephone
                      param.projectBasis = this.temp.projectBasis
                      param.totalInvestment = this.temp.totalInvestment
                      param.fundSourceCityFinacial = this.temp.fundSourceCityFinacial
                      param.fundSourceDistrictFinance = this.temp.fundSourceDistrictFinance
                      param.fundSourceOthers = this.temp.fundSourceOthers
                      param.startTimePlan = this.temp.startTimePlan
                      param.endTimePlan = this.temp.endTimePlan
                      param.startTimeActual = this.temp.startTimeActual
                      param.endTimeActual = this.temp.endTimeActual
                     /* param.investmentSupervision = this.temp.investmentSupervision
                      param.investmentSupervisionTime = this.temp.investmentSupervisionTime*/
                      param.constructionSupervision = this.temp.constructionSupervision
                      param.constructionSupervisionTime = this.temp.constructionSupervisionTime
                      param.finacialSupervision = this.temp.finacialSupervision
                      param.finacialSupervisionTime = this.temp.finacialSupervisionTime
                      param.projectMainUnit = this.temp.projectMainUnit
                      param.phone = this.temp.phone
                      param.deleteflag = this.temp.deleteflag
                      createApi(param).then((r) => {
                        this.notify(r)
                        if (r.success) {
                          this.resetTemp()
                          // 从父组件调用此方法，进行回调下
                          if (this.isModule) {
                            this.$emit('updateResult')
                          }
                        }
                      })
                    })
                      .catch(_ => {
                      })

                  }
                })
              }



            }
          })
        }


      },
      // 给外部调用，修改记录，暂存，状态status修改为3
      updateDataTmp() {
        this.$refs['dataForm'].validate((valid) => {
          if (valid) {
            // columnsTag.column4Add
            const param = { id: this.temp.id }
            param.unitBidderId = this.temp.unitBidderId
            param.status = 3
            param.remark = this.temp.remark
            param.rejectReason = this.temp.rejectReason
            param.fileAddress = this.temp.fileAddress
            param.projectName = this.temp.projectName
            param.projectAddr = this.temp.projectAddr
            param.projectMainUnitLinkman = this.temp.projectMainUnitLinkman
            param.telephone = this.temp.telephone
            param.projectBasis = this.temp.projectBasis
            param.totalInvestment = this.temp.totalInvestment
            param.fundSourceCityFinacial = this.temp.fundSourceCityFinacial
            param.fundSourceDistrictFinance = this.temp.fundSourceDistrictFinance
            param.fundSourceOthers = this.temp.fundSourceOthers
            param.startTimePlan = this.temp.startTimePlan
            param.endTimePlan = this.temp.endTimePlan
            param.startTimeActual = this.temp.startTimeActual
            param.endTimeActual = this.temp.endTimeActual
            /*param.investmentSupervision = this.temp.investmentSupervision
            param.investmentSupervisionTime = this.temp.investmentSupervisionTime*/
            param.constructionSupervision = this.temp.constructionSupervision
            param.constructionSupervisionTime = this.temp.constructionSupervisionTime
            param.finacialSupervision = this.temp.finacialSupervision
            param.finacialSupervisionTime = this.temp.finacialSupervisionTime
            param.projectMainUnit = this.temp.projectMainUnit
            param.phone = this.temp.phone
            param.deleteflag = this.temp.deleteflag
            updateApi(param).then((r) => {
              this.notify(r)
              if (r.success) {
                this.resetTemp()
                // 从父组件调用此方法，进行回调下
                if (this.isModule) {
                  this.$emit('updateResult')
                }
              }
            })
          }
        })
      },
      // 给外部调用，清除校验
      clearValidate() {
        this.$refs['dataForm'].clearValidate()
      }
    }

  }
</script>
<style>

</style>
